<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(function(){
	
	$('#a1').click(f2);
	
});

function f1(){
	$.ajax({
		"url":"number.do",
		"type":"post",
		"dataType":"text",
		"success":function(data){
			$('#msg').html(data);
		}
	});
}
function f2(){
	/*
		load方法:向服务器发送异步请求
		(number.do)这个地址,然后将服务器返回的数据添加到符合要求的节点之上
	*/
	$('#msg').load('number.do');
}

</script>
</head>
<body style="font-size:30px;font-style:italic;">
	<a id="a1" href="javascript:;">点击这里显示一个随机数</a><br/><span id="msg"></span>
</body>
</html>